This invention relates to systems and methods for automatically focusing a machine vision inspection system.
2. Description of Related Art
Methods for operating a machine vision inspection system with a camera and stage that are movable relative to one another to focus on and inspect selected features of a workpiece on the stage are generally known. Precision machine vision inspection systems can be used to obtain precise dimensional measurements of inspected objects and to inspect various other object characteristics. Such systems may include a computer, a camera and optical system and a precision stage that is movable in multiple directions to allow the camera to scan the features of a workpiece that is being inspected. One exemplary prior art system, of a type that can be characterized as a general-purpose “off-line” precision vision system, is the commercially available QUICK VISION™ series of vision inspection machines and QVPAK™ software available from Mitutoyo America Corporation (MAC), located in Aurora, Ill. The features and operation of the QUICK VISION™ series of vision inspection machines, and the QVPAK™ software are generally described, for example, in the QVPAK 3D CNC Vision Measuring Machine Users Guide, published January 2003 and the QVPAK 3D CNC Vision Measuring Machine Operation Guide, published September 1996, each of which is incorporated herein by reference in its entirety. This product, as exemplified, for example, by the QV-302 Pro model, is able to use a microscope-type optical system to provide images of a workpiece at various magnifications.
Such general-purpose “off-line” precision vision systems often include a programmable illumination system and a lens turret with lenses of various magnifications, for example, in order to increase their versatility and provide the ability to rapidly change their configuration and imaging parameters in order to perform a wide variety of inspection tasks. There is a common need to inspect various types of objects or inspection workpieces, or various aspects of a single workpiece, using various combinations of the magnifications and the programmable illumination settings.
General purpose precision machine vision inspection systems, such as the QUICK VISION™ system, are also generally programmable and operable to provide automated video inspection. It is generally desirable that such systems include features and tools that simplify the programming and operation of such systems, such that operation and programming can be performed reliably by “non-expert” operators. For example, U.S. Pat. No. 6,542,180, which is incorporated herein by reference in its entirety, teaches a vision system that uses automated video inspection, including operations in which the lighting used to illuminate a workpiece feature is adjusted based on a plurality of selected regions of an image of the workpiece feature.
As taught in the '180 patent, automated video inspection metrology instruments generally have a programming capability that allows an automatic inspection event sequence to be defined by the user for each particular workpiece configuration. The programming capability also typically provides the ability to store and/or output the results of the various inspection operations. Such programming can be implemented either in a deliberate manner, such as text-based programming, for example, or through a recording mode that progressively “learns” the inspection event sequence by storing a sequence of machine control instructions corresponding to a sequence of inspection operations performed by a user, or through a combination of both methods. Such a recording mode is often referred to as “learn mode” or “training mode”.
In either technique, the machine control instructions are generally stored as a part program that is specific to the particular workpiece configuration. The ability to create part programs with instructions that automatically perform a predetermined sequence of inspection operations during a “run mode” of operation provides several benefits, including enhanced inspection repeatability, as well as the ability to automatically execute the same part program on a plurality of compatible machine vision inspection systems and/or at a plurality of times.
The exemplary QUICK VISION™ systems described above, as well as a number of other commercially available general purpose “off-line” vision systems, typically use conventional PC-based image acquisition accessories or components and conventional PC-based computer operating systems, such as the Windows™ operating system, to provide their methods of operation, including their methods of operating during a sequence of auto focus operations.
In general, during a sequence of auto focus operations the camera moves through a range of positions along a Z-axis and captures an image at each position. For each captured image, a focus metric is calculated and related to the corresponding position of the camera along the Z-axis at the time that the image was captured.
One known method of auto focusing is discussed in “Robust Auto focusing in Microscopy”, by Jan-Mark Geusebroek and Arnold Smeulders in ISIS Technical Report Series, Vol. 17, November 2000, which is incorporated herein by reference, in its entirety. In order to determine a Z-axis position of the camera that corresponds to an auto focus image, the discussed method estimates a position of the camera along a Z-axis based on a measured amount of time during which the camera moves from a known original position on the Z-axis at a constant velocity along the Z-axis, until the image is acquired. During the constant velocity motion, the auto focus images are captured at 40 ms intervals (video rate). The disclosed method teaches that the video hardware captures frames at a fixed rate, and that the sampling density of the focusing curve can only be influenced by adjusting the stage velocity.
Another known auto focus method and apparatus is described in U.S. Pat. No. 5,790,710, which is incorporated herein by reference, in its entirety. In the '710 patent a piezoelectric positioner is utilized in conjunction with a conventional motor-driven motion control system to control the Z-axis position. The motor-driven motion control system provides a relatively coarser resolution positioning over a full range of travel, while the piezoelectric positioner provides fast and high resolution positioning over a limited range about the nominal position established by the motor-driven system. The piezoelectric positioner provides relatively improved auto focus speed and resolution. The '710 patent further discloses using strobe lighting during auto focus operations. The '710 patent teaches acquiring auto focus images at 60 Hz.
In one embodiment, the “image was strobed near the end of the video field after the piezoelectric focus had stopped at its new position”. The '710 patent also suggests an alternative in which the position has to be moved at a constant velocity and the image frozen with a strobe. In each case, because the strobe shortens the effective exposure time of the camera, part of the normal integration period for acquiring a camera frame image can be used for moving to a new position before firing the strobe later within that integration period.